import Vue from 'vue';
import axios from './router/axios';
import VueAxios from 'vue-axios';
import App from './App';
import router from './router/router';
import './permission'; // 权限
import './error'; // 日志
import store from './store';
import { loadStyle } from './util/util'
import * as urls from '@/config/env';
import Element from 'element-ui';
// import { utils } from './util/getUrlKey.js';  //获取url参数
import {
    iconfontUrl,
    iconfontVersion
} from '@/config/env';
import i18n from './lang' // Internationalization
import './styles/common.scss';

import basicContainer from './components/basic-container/main'

Vue.use(router)
Vue.use(VueAxios, axios)
Vue.use(Element, {
    i18n: (key, value) => i18n.t(key, value)
})


import ElementUI from 'element-ui'
// import 'element-ui/lib/theme-chalk/index.css'
import ELeMultiCascader from "ele-multi-cascader"
// import "ele-multi-cascader/dist/cascader.css"
Vue.use(ElementUI);
Vue.use(ELeMultiCascader);
// Vue.use(QRCode);  //注册

Vue.use(window.AVUE, {
    i18n: (key, value) => i18n.t(key, value)
})
// Vue.prototype.$utils=utils   //注册全局方法
//注册全局容器
Vue.component('basicContainer', basicContainer)
// 加载相关url地址
Object.keys(urls).forEach(key => {
    Vue.prototype[key] = urls[key];
})

import dayjs from 'dayjs'
import 'dayjs/locale/es' // load on demand
dayjs.locale('es')
Vue.prototype.dayjs = dayjs;
Vue.use(dayjs)

// 动态加载阿里云字体库
iconfontVersion.forEach(ele => {
    loadStyle(iconfontUrl.replace('$key', ele));
})
// 引入vue-amap
import VueAMap from 'vue-amap'

Vue.use(VueAMap)
// 动态加载阿里云字体库
iconfontVersion.forEach(ele => {
    loadStyle(iconfontUrl.replace('$key', ele));
})
// 初始化vue-amap
// VueAMap.initAMapApiLoader({
//   // 高德的key
//   key: 'YOUR_KEY',
//   // 插件集合
//   plugin: ['AMap.Autocomplete', 'AMap.PlaceSearch', 'AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PolyEditor', 'AMap.CircleEditor','AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType',],
//   // 高德 sdk 版本，默认为 1.4.4
//   v: '1.4.4'
// })
VueAMap.initAMapApiLoader({
  key: '57358ac872e8f834962f8aa7072c7bfe',
  plugin: ['AMap.Autocomplete', 'AMap.PlaceSearch', 'AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType',  'AMap.GeoLocation','GeoLocation','AMap.PolyEditor', 'AMap.CircleEditor', 'AMap.Geocoder','AMap.AMapManager','AMap.MouseTool','AMap.DistrictSearch','AMap.Driving'],
  uiVersion: '1.0.11', // 版本号
  v: '1.4.14'
})
Vue.config.productionTip = false;
import vueTree from 'vue-tree-jf'

Vue.use(vueTree);
new Vue({
    router,
    store,
    i18n,
    render: h => h(App)
}).$mount('#app')
